<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var fruit = prompt("请输入查询的水果：")
        switch (fruit) {
            case '苹果':
                alert("苹果的价格是3.5元/斤")
                break
            case '桃子':
                alert("桃子的价格是3元/斤")
                break
            default:
                alert("没有此水果")
        }
    </script>
    </script>
</body>

</html>